﻿<%@ Page Language="C#" %>
<%@ Import Namespace="System.Collections.Generic" %>
<%@ Register src="~/App_Control/Dashboard.ascx" tagname="Dashboard" tagprefix="uc" %>
<%@ Register src="~/App_Control/Alerts.ascx" tagname="Alerts" tagprefix="uc" %>
<%@ Register src="~/App_Control/Tabs.ascx" tagname="Tabs" tagprefix="uc" %>

<style>
.album
{
	background:#F7F7F7 none repeat scroll 0%;
    border-bottom:1px solid #D8DFEA;
    margin:0px;
    padding:10px;
}
.album .item
{
	padding: 3px 2px;
	text-align: center;
	vertical-align: middle;
	width: 120px;
	height: 120px;
	margin: auto 0;
	float: left;
}
.album .item img
{
	border: solid 1px #CCCCCC;
	background: white none repeat scroll 0%;
	padding: 6px;
}
.album .item img:hover 
{
	border: 1px solid #3B5998;
}
</style>

<fb:title><%=Title%></fb:title>
<uc:Dashboard ID="d" runat="server" />
<uc:Alerts ID="a" runat="server" />
<uc:Tabs ID="t" runat="server" />


<asp:ListView ID="lvPhotos" runat="server">
    <LayoutTemplate>
        <div class="album clearfix">
            <fb:explanation>
                <fb:message>Please select a featured photograph.</fb:message>
                A link to this album, <b><%=Title%></b>, will be featured on 
                your Facebook profile. Before that can happen, however, you need
                to pick a photo for this album. 
                <br />
                Press the <u>Select</u> button 
                directly underneath the photo that you would like to feature.
            </fb:explanation>
            <asp:PlaceHolder ID="itemContainer" runat="server" />
        </div>
    </LayoutTemplate>
    <ItemTemplate>
        <div class="item">
            <img src="<%#Eval("TinyUrl")%>" /><br />
            <form method="post" action="update/">
                <input type="hidden" name="photo_id" value='<%#Eval("ImageId")%>' />
                <input type="hidden" name="album_id" value='<%=AlbumID%>' />
                <input type="submit" value="Select" class="inputsubmit" />
            </form>
        </div>
    </ItemTemplate>
</asp:ListView>


<div class="footer" style="clear:both; padding: 0px 10px;">
    Contains <%=ImageCount%> photos.
</div>


<script runat="server">
private Album album;
private List<ImageUrlSet> photos;
protected override void OnLoad(EventArgs e) 
{
    SmfbService smfb = new SmfbService();
    album = smfb.GetAlbum();
    photos = smfb.GetPhotos();
    this.lvPhotos.DataSource = photos;
    this.lvPhotos.DataBind();
}
public new String Title { get { return album.Title; } }
public String ImageCount { get { return photos.Count.ToString(); } }
public String AlbumID { get { return album.ID; } }
</script>